----------------------------------------------------------------
-- Global Variables
----------------------------------------------------------------

EA_Window_OpenRvRPopup = {}

----------------------------------------------------------------
-- Local Variables
----------------------------------------------------------------

----------------------------------------------------------------
-- EA_Window_OpenRvRPopup Functions
----------------------------------------------------------------

function EA_Window_OpenRvRPopup.Initialize()       

    LabelSetText( "EA_Window_OpenRvRPopupTitleBarText", GetPregameString( StringTables.Pregame.LABEL_OPEN_RVR_ADDENDUM_TITLE))
    LabelSetText( "EA_Window_OpenRvRPopupScrollWindowScrollChildLabel", GetPregameString( StringTables.Pregame.LABEL_OPEN_RVR_ADDENDUM))
    ButtonSetText("EA_Window_OpenRvRPopupAcceptButton", GetPregameString( StringTables.Pregame.LABEL_PRESELECT_ACCEPT ))
    ButtonSetText("EA_Window_OpenRvRPopupDeclineButton", GetPregameString( StringTables.Pregame.LABEL_PRESELECT_DECLINE ))

    ScrollWindowUpdateScrollRect( "EA_Window_OpenRvRPopupScrollWindow" )
end

function EA_Window_OpenRvRPopup.Shutdown()
end

function EA_Window_OpenRvRPopup.Show()
    WindowSetShowing("EA_Window_OpenRvR", true)
end

function EA_Window_OpenRvRPopup.ToggleShowing()
    local showing = WindowGetShowing("EA_Window_OpenRvR")
    WindowSetShowing("EA_Window_OpenRvR", not showing)
end

function EA_Window_OpenRvRPopup.Accept()
    if (DoesWindowExist("ServerSelectWindow")) then
        ServerSelectWindow.SelectServerAddendumAccepted()
    end
    WindowSetShowing("EA_Window_OpenRvR", false)
end

function EA_Window_OpenRvRPopup.Decline()
    WindowSetShowing("EA_Window_OpenRvR", false)
end
